<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Pepr3D: pepr3d::GeometryUtils Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="pepr3d_icon.svg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Pepr3D
   &#160;<span id="projectnumber">v1.0</span>
   </div>
   <div id="projectbrief">Pepr3D is a 3D graphics editor designed for FDM printing</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classpepr3d_1_1_geometry_utils.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classpepr3d_1_1_geometry_utils-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">pepr3d::GeometryUtils Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Static utility functions that are not closely tied to <a class="el" href="classpepr3d_1_1_geometry.html" title="The whole geometry of a model that the user is painting.">Geometry</a>.  
 <a href="classpepr3d_1_1_geometry_utils.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_geometry_utils_8h_source.html">GeometryUtils.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpepr3d_1_1_geometry_utils_1_1_tri_ray_int_visitor.html">TriRayIntVisitor</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a6fe5d1ec681688da1e249a0f87a4944d"><td class="memTemplParams" colspan="2">template&lt;typename K &gt; </td></tr>
<tr class="memitem:a6fe5d1ec681688da1e249a0f87a4944d"><td class="memTemplItemLeft" align="right" valign="top">static bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classpepr3d_1_1_geometry_utils.html#a6fe5d1ec681688da1e249a0f87a4944d">simplifyPolygon</a> (CGAL::Polygon_2&lt; K &gt; &amp;poly)</td></tr>
<tr class="memdesc:a6fe5d1ec681688da1e249a0f87a4944d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Simplify polygon, removing unnecessary vertices.  <a href="#a6fe5d1ec681688da1e249a0f87a4944d">More...</a><br /></td></tr>
<tr class="separator:a6fe5d1ec681688da1e249a0f87a4944d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa40d71268a74cdeb820d931175f14df0"><td class="memItemLeft" align="right" valign="top"><a id="aa40d71268a74cdeb820d931175f14df0"></a>
static std::vector&lt; DataTriangle::K::Point_3 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpepr3d_1_1_geometry_utils.html#aa40d71268a74cdeb820d931175f14df0">pointsOnCircle</a> (const DataTriangle::K::Circle_3 &amp;circle, int segments)</td></tr>
<tr class="memdesc:aa40d71268a74cdeb820d931175f14df0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get equidistant points on circle. <br /></td></tr>
<tr class="separator:aa40d71268a74cdeb820d931175f14df0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a376d662a35f0d4583276472d4576ae7b"><td class="memTemplParams" colspan="2"><a id="a376d662a35f0d4583276472d4576ae7b"></a>
template&lt;typename K &gt; </td></tr>
<tr class="memitem:a376d662a35f0d4583276472d4576ae7b"><td class="memTemplItemLeft" align="right" valign="top">static CGAL::Orientation&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classpepr3d_1_1_geometry_utils.html#a376d662a35f0d4583276472d4576ae7b">shoelaceOrientationTest</a> (const CGAL::Polygon_2&lt; K &gt; &amp;poly)</td></tr>
<tr class="memdesc:a376d662a35f0d4583276472d4576ae7b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Determine orientation of a polygon using shoelace formula Replacement for potentionally buggy <a class="el" href="namespace_c_g_a_l.html" title="CGAL Serialization functions.">CGAL</a> implementation. <br /></td></tr>
<tr class="separator:a376d662a35f0d4583276472d4576ae7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7efa1cf650e08d63cfae3f9a7a5c067"><td class="memTemplParams" colspan="2"><a id="ab7efa1cf650e08d63cfae3f9a7a5c067"></a>
template&lt;typename Traits_2 &gt; </td></tr>
<tr class="memitem:ab7efa1cf650e08d63cfae3f9a7a5c067"><td class="memTemplItemLeft" align="right" valign="top">static bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classpepr3d_1_1_geometry_utils.html#ab7efa1cf650e08d63cfae3f9a7a5c067">is_valid_polygon_with_holes</a> (const typename Traits_2::Polygon_with_holes_2 &amp;pgn, const Traits_2 &amp;traits)</td></tr>
<tr class="memdesc:ab7efa1cf650e08d63cfae3f9a7a5c067"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check validity of a polygon with holes using shoelace formula instead of a <a class="el" href="namespace_c_g_a_l.html" title="CGAL Serialization functions.">CGAL</a> orientation test. <br /></td></tr>
<tr class="separator:ab7efa1cf650e08d63cfae3f9a7a5c067"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a4acf058ecff218c2f64cb92f6a4090"><td class="memTemplParams" colspan="2">template&lt;typename Traits_2 &gt; </td></tr>
<tr class="memitem:a0a4acf058ecff218c2f64cb92f6a4090"><td class="memTemplItemLeft" align="right" valign="top">static bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classpepr3d_1_1_geometry_utils.html#a0a4acf058ecff218c2f64cb92f6a4090">has_valid_orientation_polygon_with_holes</a> (const typename Traits_2::Polygon_with_holes_2 &amp;pgn, const Traits_2 &amp;traits)</td></tr>
<tr class="separator:a0a4acf058ecff218c2f64cb92f6a4090"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a982761c1e66eb293064c3acbffe5ede3"><td class="memItemLeft" align="right" valign="top">static std::pair&lt; DataTriangle::K::Point_3, double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpepr3d_1_1_geometry_utils.html#a982761c1e66eb293064c3acbffe5ede3">getBoundingSphere</a> (const std::vector&lt; DataTriangle::K::Point_3 &gt; &amp;shape)</td></tr>
<tr class="memdesc:a982761c1e66eb293064c3acbffe5ede3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get min bounding sphere of a point shape.  <a href="#a982761c1e66eb293064c3acbffe5ede3">More...</a><br /></td></tr>
<tr class="separator:a982761c1e66eb293064c3acbffe5ede3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89cc912fcdca2c33502aa050841d660e"><td class="memItemLeft" align="right" valign="top">static std::pair&lt; DataTriangle::K::Point_3, double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpepr3d_1_1_geometry_utils.html#a89cc912fcdca2c33502aa050841d660e">getBoundingSphere</a> (const std::vector&lt; DataTriangle::Triangle &gt; &amp;triangles)</td></tr>
<tr class="memdesc:a89cc912fcdca2c33502aa050841d660e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get min bounding sphere of a set of triangles.  <a href="#a89cc912fcdca2c33502aa050841d660e">More...</a><br /></td></tr>
<tr class="separator:a89cc912fcdca2c33502aa050841d660e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a4bbf6d68fa3474b7ae286d584ebe94"><td class="memItemLeft" align="right" valign="top">static std::pair&lt; DataTriangle::K::Point_3, double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpepr3d_1_1_geometry_utils.html#a8a4bbf6d68fa3474b7ae286d584ebe94">getBoundingSphere</a> (const DataTriangle::Triangle &amp;triangle)</td></tr>
<tr class="memdesc:a8a4bbf6d68fa3474b7ae286d584ebe94"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get min bounding sphere of a triangle.  <a href="#a8a4bbf6d68fa3474b7ae286d584ebe94">More...</a><br /></td></tr>
<tr class="separator:a8a4bbf6d68fa3474b7ae286d584ebe94"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c0957732e9c372ca63b5271cf91d98d"><td class="memItemLeft" align="right" valign="top"><a id="a3c0957732e9c372ca63b5271cf91d98d"></a>
static float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpepr3d_1_1_geometry_utils.html#a3c0957732e9c372ca63b5271cf91d98d">segmentPointDistanceSquared</a> (const glm::vec3 &amp;start, const glm::vec3 &amp;end, const glm::vec3 &amp;point)</td></tr>
<tr class="memdesc:a3c0957732e9c372ca63b5271cf91d98d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find squared distance between a line segment and a point in 3D space. <br /></td></tr>
<tr class="separator:a3c0957732e9c372ca63b5271cf91d98d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afee093fc93f94d5d7552611a34931ea2"><td class="memItemLeft" align="right" valign="top"><a id="afee093fc93f94d5d7552611a34931ea2"></a>
static std::optional&lt; glm::vec3 &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpepr3d_1_1_geometry_utils.html#afee093fc93f94d5d7552611a34931ea2">triangleRayIntersection</a> (const class <a class="el" href="classpepr3d_1_1_data_triangle.html">DataTriangle</a> &amp;tri, ci::Ray ray)</td></tr>
<tr class="memdesc:afee093fc93f94d5d7552611a34931ea2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Find intersection point of a ray and a single triangle If the intersection is a segment return one of the edge points. <br /></td></tr>
<tr class="separator:afee093fc93f94d5d7552611a34931ea2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c82cbd47ad61dbf93685a3daf47c49a"><td class="memItemLeft" align="right" valign="top"><a id="a1c82cbd47ad61dbf93685a3daf47c49a"></a>
static bool&#160;</td><td class="memItemRight" valign="bottom"><b>isFullyInsideASphere</b> (const DataTriangle::K::Triangle_3 &amp;tri, const DataTriangle::K::Point_3 &amp;origin, double radius)</td></tr>
<tr class="separator:a1c82cbd47ad61dbf93685a3daf47c49a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ee493c277ad6aa4e87b2508a0f6c2c9"><td class="memItemLeft" align="right" valign="top"><a id="a7ee493c277ad6aa4e87b2508a0f6c2c9"></a>
static bool&#160;</td><td class="memItemRight" valign="bottom"><b>isFullyInsideASphere</b> (const DataTriangle::K::Triangle_3 &amp;tri, const glm::vec3 &amp;origin, double radius)</td></tr>
<tr class="separator:a7ee493c277ad6aa4e87b2508a0f6c2c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Static utility functions that are not closely tied to <a class="el" href="classpepr3d_1_1_geometry.html" title="The whole geometry of a model that the user is painting.">Geometry</a>. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a982761c1e66eb293064c3acbffe5ede3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a982761c1e66eb293064c3acbffe5ede3">&#9670;&nbsp;</a></span>getBoundingSphere() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::pair&lt; DataTriangle::K::Point_3, double &gt; pepr3d::GeometryUtils::getBoundingSphere </td>
          <td>(</td>
          <td class="paramtype">const std::vector&lt; DataTriangle::K::Point_3 &gt; &amp;&#160;</td>
          <td class="paramname"><em>shape</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get min bounding sphere of a point shape. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">shape</td><td>Polygonal shape represented by a set of points </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a89cc912fcdca2c33502aa050841d660e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a89cc912fcdca2c33502aa050841d660e">&#9670;&nbsp;</a></span>getBoundingSphere() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::pair&lt; DataTriangle::K::Point_3, double &gt; pepr3d::GeometryUtils::getBoundingSphere </td>
          <td>(</td>
          <td class="paramtype">const std::vector&lt; DataTriangle::Triangle &gt; &amp;&#160;</td>
          <td class="paramname"><em>triangles</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get min bounding sphere of a set of triangles. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">shape</td><td>Polygonal shape represented by a set of points </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a8a4bbf6d68fa3474b7ae286d584ebe94"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8a4bbf6d68fa3474b7ae286d584ebe94">&#9670;&nbsp;</a></span>getBoundingSphere() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::pair&lt; DataTriangle::K::Point_3, double &gt; pepr3d::GeometryUtils::getBoundingSphere </td>
          <td>(</td>
          <td class="paramtype">const DataTriangle::Triangle &amp;&#160;</td>
          <td class="paramname"><em>triangle</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get min bounding sphere of a triangle. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">shape</td><td>Polygonal shape represented by a set of points </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a0a4acf058ecff218c2f64cb92f6a4090"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0a4acf058ecff218c2f64cb92f6a4090">&#9670;&nbsp;</a></span>has_valid_orientation_polygon_with_holes()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Traits_2 &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool pepr3d::GeometryUtils::has_valid_orientation_polygon_with_holes </td>
          <td>(</td>
          <td class="paramtype">const typename Traits_2::Polygon_with_holes_2 &amp;&#160;</td>
          <td class="paramname"><em>pgn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Traits_2 &amp;&#160;</td>
          <td class="paramname"><em>traits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Outer boundary must be counterclockwise</p>
<p>Holes must be clockwise </p>

</div>
</div>
<a id="a6fe5d1ec681688da1e249a0f87a4944d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6fe5d1ec681688da1e249a0f87a4944d">&#9670;&nbsp;</a></span>simplifyPolygon()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static bool pepr3d::GeometryUtils::simplifyPolygon </td>
          <td>(</td>
          <td class="paramtype">CGAL::Polygon_2&lt; K &gt; &amp;&#160;</td>
          <td class="paramname"><em>poly</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Simplify polygon, removing unnecessary vertices. </p>
<dl class="section return"><dt>Returns</dt><dd>true Polygon was simplified </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Home/MFF/1-Mgr/projekt/pepr3d/src/geometry/<a class="el" href="_geometry_utils_8h_source.html">GeometryUtils.h</a></li>
<li>D:/Home/MFF/1-Mgr/projekt/pepr3d/src/geometry/GeometryUtils.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacepepr3d.html">pepr3d</a></li><li class="navelem"><a class="el" href="classpepr3d_1_1_geometry_utils.html">GeometryUtils</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
  </ul>
</div>
</body>
</html>
